package com.zyzd.baseretrofit;


import android.content.Intent;
import android.view.View;
import android.widget.TextView;

import com.zyzd.baseretrofit.activity.PerformerActivity;
import com.zyzd.baseretrofit.base.activity.BaseNetActivity;
import com.zyzd.baseretrofit.net.RetrofitHelper;

import java.io.File;
import java.util.ArrayList;

import butterknife.Bind;


public class MainActivity extends BaseNetActivity<ArrayList<String>> {


    @Bind(R.id.tv)
    TextView tv;

    @Override
    protected void parseData(ArrayList<String> list) {
        tv.setText(list.toString());
    }

    @Override
    public void initData() {

    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_main;
    }

    public void uploadImage(View view) {
        ArrayList<File> files = new ArrayList<>();
        files.add(new File("/storage/emulated/0/DCIM/IMG_2061275269.jpg"));
        toSubscribe(RetrofitHelper.getUploadImageObservable(files), getSubscriber());
    }

    public void openPerformanceActivity(View view) {
        Intent intent = new Intent(this, PerformerActivity.class);
        startActivity(intent);
    }

}
